<?php

declare(strict_types=1);
/**
 * This file is part of Hyperf.
 *
 * @link     https://www.hyperf.io
 * @document https://hyperf.wiki
 * @contact  group@hyperf.io
 * @license  https://github.com/hyperf/hyperf/blob/master/LICENSE
 */

namespace App\Utils\Enum;

class LiveEnum
{
    public const int STATUS_CLOSED = 1;

    public const int STATUS_LIVING = 2;

    public const int STATUS_FORBIDDEN = 9;

    public const int BLACKLIST_OP_ROLE_ANCHOR = 1;

    public const int BLACKLIST_OP_ROLE_MANAGER = 2;

    public const int BLACKLIST_OP_ROLE_SYSTEM = 9;

    /**
     * 拉黑.
     */
    public const int BLACKLIST_OP_TYPE_ADD = 1;

    /**
     * 解除.
     */
    public const int BLACKLIST_OP_TYPE_REM = 2;

    /**
     * 关注.
     */
    public const int FOLLOW_OP_FOLLOW = 1;

    /**
     * 取关.
     */
    public const int FOLLOW_OP_CANCEL = 2;

    /**
     * 获取操作黑名单的角色.
     * @param mixed $role
     */
    public static function getBlacklistOpRole($role): string
    {
        return match ($role) {
            self::BLACKLIST_OP_ROLE_ANCHOR => '主播',
            self::BLACKLIST_OP_ROLE_MANAGER => '管理员',
            self::BLACKLIST_OP_ROLE_SYSTEM => '系统',
            default => '未知',
        };
    }
}
